package practise.alogrithm.hundredInterviewQuestions;

import java.util.List;

/**
 * Created by richard on 6/2/14.
 */
public class MaxSumOfArray {
    int[] integers;
    public MaxSumOfArray(int[] ints){
        integers = ints;
    }
    public int getMaxSum(){
        int sum = 0;
        int maxSum = 0;
        if(integers.length==0){
            return 0;
        }
        for(int i=0; i< integers.length;i++){
            sum = Math.max(integers[i],sum);
            maxSum = Math.max(maxSum,sum);
        }

        return maxSum;
    }
}
